<template>
  <div class="Department">
    <el-main>
      <div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="资产分类:" prop="assetTypeId">
            <el-col :span="7">
              <div class="grid-content bg-purple">
                <!-- <el-select v-model="form.statement" placeholder="请选择分类">
                  <el-option label="土地、房屋及建筑物" value="Houses"></el-option>
                  <el-option label="通用设备" value="FlexibleUnit"></el-option>
                  <el-option label="专用设备" value="SpecialEquipment"></el-option>
                  <el-option label="交通运输设备" value="TransportEquipment"></el-option>
                  <el-option label="电气设备" value="ElectricalEquipment"></el-option>
                  <el-option label="电子产品及通讯设备" value="ElectronicProducts"></el-option>
                  <el-option label="仪器仪表设备" value="Instrument"></el-option>
                  <el-option label="文艺体育设备" value="SportsEquipment"></el-option>
                  <el-option label="图书文物及陈列品" value="Books"></el-option>
                  <el-option label="家具用具及其他类" value="Furniture"></el-option>
                </el-select> -->
                <el-select v-model="form.assetTypeId" @change="consolelog1" placeholder="资产类别">
                  <el-option
                    v-for="item in list1"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  ></el-option>
                </el-select>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-button type="primary" icon="el-icon-document">导出</el-button>
              </div>
            </el-col>
          </el-form-item>
        </el-form>
      </div>
      <el-table
        ref="multipleTable"
        :data="tableData3"
        border
        height="361"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <!-- <el-table-column type="selection" width="55"></el-table-column> -->
        <el-table-column prop="number" label="编号" style="width: 25%"></el-table-column>
        <el-table-column prop="name" label="名称" style="width: 25%"></el-table-column>
        <el-table-column prop="assetNumber" label="资产数量" style="width: 25%"></el-table-column>
        <el-table-column prop="assetAmount" label="资产金额(万元)" style="width: 25%"></el-table-column>
      </el-table>
      <br>
      <div class="block">
        <el-row :gutter="20">
          <el-col :span="4">
            <div class="grid-content bg-purple">
              <span class="demonstration">已选择0条</span>
            </div>
          </el-col>
          <el-col :span="10">
            <div class="grid-content bg-purple">
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage4"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="10"
                layout="prev, pager, next, sizes, jumper"
                :total="400"
              ></el-pagination>
            </div>
          </el-col>
        </el-row>
      </div>
    </el-main>
  </div>
</template>
<script>
import { axiosPost, axiosGet } from "@/api/index.js";
export default {
  data() {
    return {
      form: {
        statement: "",
        assetTypeId: "",
      },
      rules: {
        statement: [
          { required: true, message: "请选择资产分类", trigger: "change" }
        ]
      },tableData3:[],
      currentPage1: 5,
      currentPage2: 5,
      currentPage3: 5,
      currentPage4: 4,
      multipleSelection: [],
      list1: []
    };
  },
  beforeMount(){
    //资产类别接口
    axiosGet("Asset/GetAssetTypeList", null).then(res => {
      if (res.status === 200 && res.data.success) {
        this.list1 = res.data.data;
      } else {
      }
    });
  },
  methods: {
    toggleSelection(rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    consolelog1() {
      // console.log(this.ruleForm.moudle);
    },
  }
};
</script>
<style lang="scss" scoped>
</style>
